﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoUpdater
{
    public class Package
    {
        private static Package instance;
        private static object mutex = new object();
        private Package(string path) {
            using (var reader = System.IO.File.OpenText(path)) {
                this.Json = reader.ReadToEnd();
            }
        }

        public static Package GetInstance(string path) {
            if (instance == null) {
                lock (mutex) {
                    if (instance == null) {
                        instance = new Package(path);
                    }
                }
            }
            return instance;
        }

        public String Json { get; set; }
    }
}
